postgresql15 Linux7 YUM安装

# Install the repository RPM:
sudo yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm

# Install PostgreSQL:
sudo yum install -y postgresql15-server

# Optionally initialize the database and enable automatic start:
sudo /usr/pgsql-15/bin/postgresql-15-setup initdb
sudo systemctl enable postgresql-15
sudo systemctl start postgresql-15
Warning

安装postgresql 时会报错。报错信息如下。

--> 解决依赖关系完成
错误:软件包:postgresql15-server-15.2-1PGDG.rhel7.x86_64 (pgdg15)
          需要:libzstd.so.1()(64bit)
错误:软件包:postgresql15-15.2-1PGDG.rhel7.x86_64 (pgdg15)
          需要:libzstd.so.1()(64bit)
错误:软件包:postgresql15-15.2-1PGDG.rhel7.x86_64 (pgdg15)
          需要:libzstd >= 1.4.0
 您可以尝试添加 --skip-broken 选项来解决该问题
 您可以尝试执行:rpm -Va --nofiles --nodigest

解决方法:
请安装扩展源 yum Install epel-release